package cn.tianshi.board;

import cn.tianshi.board.bean.ApiModel;

import java.awt.*;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;

/**
 * @author lin2.zhang
 */
public class Main {

    public static void main(String[] args) {
        String ret = "";
        Clipboard sysClip = Toolkit.getDefaultToolkit().getSystemClipboard();
        // 获取剪切板中的内容
        Transferable clipTf = sysClip.getContents(null);

        if (clipTf != null) {
            // 检查内容是否是文本类型
            if (clipTf.isDataFlavorSupported(DataFlavor.stringFlavor)) {
                try {
                    ret = (String) clipTf
                            .getTransferData(DataFlavor.stringFlavor);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
        Analysis analysis = new Analysis();
        ApiModel apiModel = analysis.analysis(87, ret);
        CreateSql createSql = new CreateSql();
        createSql.createSql("http://172.16.71.188:9513", apiModel);
    }
}
